package com.atguigu.educms.controller;


import com.atguigu.commonutils.R;
import com.atguigu.educms.entity.CrmBanner;
import com.atguigu.educms.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.Cacheable;

import java.util.List;

/**
 * <p>
 * 前台banner显示
 * </p>
 *
 * @author ycw
 * @since 2020-08-30
 */
@RestController
@RequestMapping("/educms/bannerfront")
@CrossOrigin
public class BannerFrontController {

    @Autowired
    private CrmBannerService bannerService;
    //查询所有banner  不需要啥条件
    //要加Redis单独写一个service方法
    @GetMapping("getAllBanner")
    public R getAllBanner(){  //最终返回一个list结合
        List<CrmBanner> list = bannerService.serviceAllBanner();
        return R.ok().data("list",list);
    }
}

